package com.hrms.domain;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import java.io.Serializable;
import java.util.Date;
import lombok.Data;

/**
 * 
 * @TableName t_attendance
 */
@TableName(value ="t_attendance")
@Data
public class Attendance implements Serializable {
    /**
     * 考勤ID
     */
    @TableId(type = IdType.AUTO)
    private Integer attendanceId;

    /**
     * 员工编号
     */
    private Integer empNo;

    /**
     * 考勤日期,yyyymmdd
     */
    private String date;

    /**
     * 考勤月份yyyymm
     */
    private String month;

    /**
     * 上班打卡时间
     */
    private Date checkinTime;

    /**
     * 下班打卡时间
     */
    private Date checkoutTime;

    /**
     * 1、正常打卡 2、迟到且早退 3、迟到 4、早退  5、缺勤

     */
    private String status;

    @TableField(exist = false)
    private static final long serialVersionUID = 1L;

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        Attendance other = (Attendance) that;
        return (this.getAttendanceId() == null ? other.getAttendanceId() == null : this.getAttendanceId().equals(other.getAttendanceId()))
            && (this.getEmpNo() == null ? other.getEmpNo() == null : this.getEmpNo().equals(other.getEmpNo()))
            && (this.getDate() == null ? other.getDate() == null : this.getDate().equals(other.getDate()))
            && (this.getMonth() == null ? other.getMonth() == null : this.getMonth().equals(other.getMonth()))
            && (this.getCheckinTime() == null ? other.getCheckinTime() == null : this.getCheckinTime().equals(other.getCheckinTime()))
            && (this.getCheckoutTime() == null ? other.getCheckoutTime() == null : this.getCheckoutTime().equals(other.getCheckoutTime()))
            && (this.getStatus() == null ? other.getStatus() == null : this.getStatus().equals(other.getStatus()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getAttendanceId() == null) ? 0 : getAttendanceId().hashCode());
        result = prime * result + ((getEmpNo() == null) ? 0 : getEmpNo().hashCode());
        result = prime * result + ((getDate() == null) ? 0 : getDate().hashCode());
        result = prime * result + ((getMonth() == null) ? 0 : getMonth().hashCode());
        result = prime * result + ((getCheckinTime() == null) ? 0 : getCheckinTime().hashCode());
        result = prime * result + ((getCheckoutTime() == null) ? 0 : getCheckoutTime().hashCode());
        result = prime * result + ((getStatus() == null) ? 0 : getStatus().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", attendanceId=").append(attendanceId);
        sb.append(", empNo=").append(empNo);
        sb.append(", date=").append(date);
        sb.append(", month=").append(month);
        sb.append(", checkinTime=").append(checkinTime);
        sb.append(", checkoutTime=").append(checkoutTime);
        sb.append(", status=").append(status);
        sb.append(", serialVersionUID=").append(serialVersionUID);
        sb.append("]");
        return sb.toString();
    }
}